package be.kuleuven.mume.hulpklassen;

import org.json.JSONObject;

import android.os.Handler;
import android.os.Message;

public abstract class JSONHandler extends Handler {

	public void sendJSON(JSONObject jsonRes) {
		Message mess= this.obtainMessage(0);
		mess.obj = jsonRes;
		this.sendMessage(mess);
	}
	
	@Override
	public void handleMessage(Message msg) {
		super.handleMessage(msg);
		handelJSON((JSONObject)msg.obj);
	}
	
	public abstract void handelJSON(JSONObject obj);
}
